<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ taglib uri="http://v1.com/pn" prefix="v1" %>

<html>
<head>
<title>Wish | admin</title>
<script src='${baseurl}dwr/interface/dwrAction.js'></script>
<script src='${baseurl}dwr/engine.js'></script>
<script src='${baseurl}dwr/util.js'></script>

<script type="text/javascript">
function gotoPage(a){
	document.forms[0].action+="method.search=&page="+a;
	document.forms[0].submit();
}

function process(v, commentid){
	document.getElementsByName("commentid")[0].value=commentid;
	document.getElementsByName("step")[0].value=v;
	document.forms[0].action+="?method.process=";
	document.forms[0].submit();
}

</script>
</head>

<body>
<c:if test="${not empty message}">
	<font color="red"><c:out value="${message}" escapeXml="false"></c:out></font>
</c:if>
<form action="./wish.html" method="post">
process:
<select name="process">
<option value=""></option>
<option value="0" <c:if test="${process ==0 }">selected="selected"</c:if>>unprocessed</option>
<option value="1" <c:if test="${process ==1 }">selected="selected"</c:if>>processing</option>
<option value="2" <c:if test="${process ==2 }">selected="selected"</c:if>>processed</option>
</select><br>
processer:<input type="text" name="processer" value="${processer}"><br>
itemid:<input type="text" name="itemid" value="${itemid}"><br>
categoryid:<input type="text" name="categoryid" value="${categoryid}"><br>

<input type="submit" value="search" name="method.search"> 
<input type="hidden" name="commentid" >
<input type="hidden" name="step" >
</form>

<table width="80%" align="center" bordercolor="gray">
<tr>
	<td align="left" width="10%">process</td>
	<td align="left" width="5%">status</td>
	<td align="left" width="5%">processer</td>
	<td align="left" width="15%">regdt</td>
	<td align="left" width="15%">modidt</td>
	<td align="left" width="50%">contact</td>
	<td align="left" width="5%">product</td>
</tr>

<c:forEach items="${wishs}" var="wish" varStatus="status">
<tr>
	<td align="left" width="10%">&nbsp;
		<c:if test="${wish.process ==2 || wish.process==1}">
			<a href="#" onclick="process(-1, ${wish.commentid})">--</a>
		</c:if>
		&nbsp;
		<c:if test="${wish.process ==0 || wish.process==1}">
			<a href="#" onclick="process(1, ${wish.commentid})">+</a>
		</c:if>
	</td>
	<td align="left" width="5%" id="p${wish.commentid}">
		<c:choose>
		<c:when test="${wish.process ==0 }">unprocessed</c:when>
		<c:when test="${wish.process ==1 }">processing</c:when>
		<c:when test="${wish.process ==2 }">processed</c:when>
		<c:otherwise><c:out value="${wish.process}" /></c:otherwise>
		</c:choose>
	</td>
	<td align="left" width="5%">
		<c:out value="${wish.processer}"></c:out>
	</td>
	<td align="left" width="15%">
		<fmt:formatDate value="${wish.regdt}" pattern="yyyy-MM-dd HH:mm:ss"></fmt:formatDate>
	</td>
	<td align="left" width="15%">
		<fmt:formatDate value="${wish.modidt}" pattern="yyyy-MM-dd HH:mm:ss"></fmt:formatDate>
	</td>
	<td align="left" width="45%">
		<c:out value="${wish.contact}"></c:out>
	</td>
	<td align="left" width="5%"><a href="/hezuoshe/category.html?categoryid=${wish.categoryid}&itemid=${wish.itemid}" target="_blank">product</a></td>
</tr>
</c:forEach>
</table>
<v1:pn name="pageinfo" onclick="gotoPage({0})"></v1:pn>

</body>
</html>
